/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2012.06.07                                          *
 *                                                                       *
 *************************************************************************/

#ifndef FreeMAPs_include_COMMON_base_DefaultParameters_h
#define FreeMAPs_include_COMMON_base_DefaultParameters_h

#include "FreeMAPsConfig.h"

//C++ headers
#include <string>

/**
 * default parameters of simulation
 */
const double FREEMAPS_DEFAULT_START_TIME                       = 0.;
const double FREEMAPS_DEFAULT_END_TIME                         = 1.;
const int    FREEMAPS_DEFAULT_COARSEST_GRID_COUNT              = 10;
const int    FREEMAPS_DEFAULT_REGRID_INTERVAL                  = 5;
const double FREEMAPS_DEFAULT_REFINEMENT_CUTOFF_DIST_VALUE     = 1.;
const int    FREEMAPS_DEFAULT_REFINEMENT_CUTOFF_GRID_NUM       = 4;
const int    FREEMAPS_MAX_LEVEL_NUMBER                         = 100;
const int    FREEMAPS_MAX_DIFFERENTIAL_ORDER                   = 2;
const double FREEMAPS_DEFAULT_GRID_SIZE                        = 0.1;


//Level Set Method Default parameters
const std::string  LSM_DEFAULT_SPATIAL_DISCRETE_TYPE            = "WENO_5";
const unsigned int LSM_DEFAULT_SPATIAL_DISCRETE_WENO_ORDER      = 5;
const unsigned int LSM_DEFAULT_SPATIAL_DISCRETE_ENO_ORDER       = 3;
const unsigned int LSM_DEFAULT_TVD_RUNGE_KUTTA_ORDER            = 3;
const double       LSM_DEFAULT_CFL_NUMBER                       = 0.5;
const int          LSM_DEFAULT_REINITIALIZATION_INTERVAL        = 10;
const int          LSM_DEFAULT_REINITIALIZATION_MAX_ITERS       = 25;
const int          LSM_STOP_TOLERANCE_MAX_ITERATIONS            = 1000;
const int          LSM_REINIT_ALG_STOP_TOLERANCE_MAX_ITERATIONS = 1000;
const int          LSM_FEA_STOP_TOLERANCE_MAX_ITERATIONS        = 1000;

/**
 * error code
 */
const int         FREEMAPS_DECIDED_VALUE        = -1;
const int         FREEMAPS_DEFAULT_VALUE        = -2;
const int         FREEMAPS_INVALID_VALUE        = -10;
const std::string FREEMAPS_DEFAULT_STRING_VALUE = "FREEMAPS_DEFAULT_STRING_VALUE";
const std::string FREEMAPS_INVALID_STRING_VALUE = "FREEMAPS_INVALID_STRING_VALUE";
const std::string FREEMAPS_EMPTY_STRING = "FREEMAPS_EMPTY_STRING_TO_REPLACE_NATIVE_ONE_TO_AVOID_SOME_ERROR";

/**
 * print format
 */
const int    FREEMAPS_NODE_WIDTH      = 7;
const int    FREEMAPS_PROCESSOR_WIDTH = 7;
const int    FREEMAPS_PATCH_WIDTH     = 7;
const int    FREEMAPS_LEVEL_WIDTH     = 4;
const int    FREEMAPS_BLOCK_WIDTH     = 7;
const int    FREEMAPS_INT_WIDTH       = 7;
const int    FREEMAPS_DOUBLE_WIDTH    = 15;

/**
 * constant
 */
const double FREEMAPS_ROUGH_TOL    = 1.e-4;
const double FREEMAPS_PI           = 3.1415926535897932384626433832795029L;
const double FREEMAPS_INF          = 1.e100;

/**
 * used for debug
 */
extern bool FREEMAPS_DEBUG_SHOW_MESSAGE;

inline double
FREEMAPS_TOL (
    const int dim = 1)
{
    double v = 1.;
    for (int i = 0; i < dim; ++i)
    {
        v *= 1.e-11;
    }
    return v;
}

#endif
